﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VentaElectrodomesticos.AsignacionStock;

namespace VentaElectrodomesticos.AbmUsuario
{
    public partial class FormElegirAnalista : Form
    {
        FormAsignacionStock formAsignacion;

        public FormElegirAnalista(FormAsignacionStock form)
        {
            InitializeComponent();
            this.formAsignacion = form;
        }

        public void insertarFila(String id,String nombre,String apellido,String dni,String mail,String provincia,String sucursal,String tipo) {
            dataGridEmpleados.Rows.Add(id, nombre, apellido, dni, mail, provincia, sucursal, tipo);
        }

        private void dataGridEmpleados_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            formAsignacion.setAnalista((String)dataGridEmpleados[0, e.RowIndex].Value, 
                                      (String)dataGridEmpleados[1, e.RowIndex].Value, 
                                      (String)dataGridEmpleados[2, e.RowIndex].Value, 
                                      (String)dataGridEmpleados[3, e.RowIndex].Value, 
                                      (String)dataGridEmpleados[5, e.RowIndex].Value, 
                                      (String)dataGridEmpleados[6, e.RowIndex].Value, 
                                      (String)dataGridEmpleados[7, e.RowIndex].Value);
            this.Close();
        }

        private void FormElegirUsuario_Load(object sender, EventArgs e)
        {

        }
    }
}
